<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>11.路由组件</title>
    <script src="js/vue.js"></script>
    <script src="https://cdn.staticfile.net/vue-router/2.7.0/vue-router.min.js"></script>
</head>
<body>
    <div id="app">
        <h1>路由组件</h1>
        <p>
            <router-link to="/huahua">花花链接</router-link>
            <router-link to="/doudou">豆豆链接</router-link>
        </p>
        <router-view></router-view>
    </div>
    <script>
        const router=new VueRouter({
            routes: [{path:'/huahua',component:{template:'<h4>花花</h4>'}}
                    ,{path:'/doudou',component:{template:'<h4>豆豆</h4>'}}]
        })
        const app = new Vue({
            el:'#app',
            router
        })
    </script>
</body>
</html>